<!DOCTYPE html>
<html>
<head>
<title>账户管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<#include "../../../include/resources.html">
<script type="text/javascript">
	$.canEdit = true;
</script>
<script type="text/javascript">
	$.canDelete = true;
</script>
<script type="text/javascript">
	$.canAdd = false;
</script>
<script type="text/javascript">
	$.canGrant = true;
</script>
<script type="text/javascript">
	var dataGrid;
	var winWidth =  1020;
	var winHeight = 460;
	
	var tppAutoRechargeTitle = "自动代扣充值";
    var tppAutoRechargeUrl =  "/modules/account/account/autoRecharge.html";
    var tppAutoRechargeWinParmeters = "'{0}','"+tppAutoRechargeTitle+"',460,420,'"+tppAutoRechargeUrl+"'";
    
    var editTitle = "资金对账"; //编辑窗口标题
	var editUrl =  "/modules/account/account/tppQueryUserBalance.html"; //编辑窗口链接地址
 
	$(function() {
		var editIndex = undefined;
		dataGrid = $('#dataGrid').datagrid({
			url : 'accountList.html',
			fit : true,
			fitColumns : true,
			border : false,
			pagination : true,
			idField : 'id',
			pageSize : pageSize,
			pageNums :1,
			pageList : pageList,
			sortName : 'id',
			sortOrder : 'desc',
			checkOnSelect : false,
			selectOnCheck : false,
			nowrap : false,
			singleSelect:true,
			columns : [ [ 			
				{ field: 'id', title: '编号', width: 50,sortable:true},
				{ field: 'username', title: '用户名', width: 80},
				{ field: 'realname', title: '真实姓名', width: 100},
				{ field: 'total', title: '账户总额(元)', width: 80 },
				{ field: 'useMoney', title: '可用金额(元)', width: 80 },
				{ field: 'noUseMoney', title: '冻结总额(元)', width: 80 },
				{ field: 'collection', title: '待收总额(元)', width: 80, sortable:true },
				{ field: 'tppUserCustId', title: '托管ID', width: 80, sortable:true },
				{	field : 'action',
					title : '操作',
					width :75,
					fixed: true,
					align:'center',
					formatter : function(value, row, index) { //功能按钮添加
						var str = '';
						if (row.tppUserCustId != null || row.tppUserCustId == "") {
							str += '<a href="javascript:void(0);" class="editBtn" onclick="$.fn.dataGridOptions.editFun('+row.id+',editTitle,winWidth,winHeight,editUrl);" title="'+editTitle+'">查看托管账户资金</a>';
						}else {
							str += '尚未开户';
						}
						return str;
					}
				}
			 ] ],
	            toolbar : '#toolbar'
		});
	});
	function exportExcel(){
		var url = "/modules/account/account/exportExcelAccount.html";
		var userName = $("#username").val();
		var realName = $("#realname").val();
		var sou = "?username=" + userName + "&realname=" + realName;
		window.location.href = url + sou;
	}
	
</script>
</head>
<body style="padding:0 20px;" >
	<div class="easyui-layout" data-options="fit : true,border : false">
		<div data-options="region:'north',border:false,collapsible:false" id="searchBox">
        	<div class="sLeft">
	            <form id="searchForm">
	            	<input type="text" id="searchName" name="searchName" class="sInput" placeholder="输入用户名/真实姓名进行搜索"  autocomplete="off" onkeydown="if(event.keyCode == 13){ $.fn.dataGridOptions.searchFun('#searchForm');return false;}"/><a href="javascript:;" title="查询" class="sBtn" onclick="$.fn.dataGridOptions.searchFun('#searchForm');">查询</a><a href="javascript:;" class="advBtn" title="条件查询">条件查询 <i class="iconfont">&#xe638;</i></a>
	            	<a href="javascript:void(0);" class="reloadIcon" onclick="dataGrid.datagrid('reload');" title="刷新" ><i class="iconfont">&#xe603;</i></a>
					<font style="color:red;">              *站岗资金 ：${guardFunds} </font>
	            </form>
	            
	            
            </div>
            <div class="sRight">
            	<a id="a" onclick="exportExcel();" href="javascript:void(0);" class="addBtn">导出excel</a>	
            </div>
            <form id="showAdw">
		        <ul class="showAdw" style="display:none;">
		        	<a href="javascript:void(0);"><i class="iconfont closeWin">&#xe628;</i></a>
		        	<li><span>用户名</span><input type="text" name="username" id="username" autocomplete="off"/></li>
		        	<li><span>真实姓名</span><input type="text" name="realname" id="realname" autocomplete="off"/></li>
		       		<li><span>&nbsp;</span><a href="javascript:void(0);" class="searchBtn sureBtn" onclick="$.fn.dataGridOptions.searchFun('#showAdw');">确定</a><a href="javascript:void(0);" class="searchBtn" onclick="$.fn.dataGridOptions.cleanFun('#searchForm');">重置</a></li>
		        </ul>
	        </form>
		</div>
		<div data-options="region:'center'" style="margin-top:30px;padding-bottom:30px;">
			<table id="dataGrid"></table>
		</div>
	</div>
</body>
</html>
<script src="${theme_dir}/js/search.js"></script>